package demo.spring.cloud.eureka.consumer;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
import org.springframework.cloud.client.loadbalancer.LoadBalanced;
import org.springframework.context.annotation.Bean;
import org.springframework.web.client.RestTemplate;

/**
 * Created by lushun.chen on 2017/4/7.
 *
 * @author lushun.chen
 */
@SpringBootApplication
@EnableDiscoveryClient
public class DemoConsumerApp {

    /**
     * @LoadBalanced 开启负载均衡能力
     */
    @Bean
    @LoadBalanced
    public RestTemplate restTemplate() {
        return new RestTemplate();
    }

    public static void main(String[] args) {
        SpringApplication.run(DemoConsumerApp.class, args);

    }
}
